programming4us
           
 
 
SQL Server

An OLAP Requirements Example: CompSales International (part 4) - Defining Dimensions and Hierarchies

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/13/2010 11:19:25 AM
Defining Dimensions and Hierarchies

You are now ready to start defining dimensions and hierarchies to your database. Dimensions are the building blocks for cubes in SSAS. You start by right-clicking the Dimensiond object in the Solution Explorer (or choosing Project, New Dimension). You can create a new (standard) dimension or define a dimension that is linked to another SSAS cube or database.

For this example, you will be creating three new cube dimensions, based on the dimension tables you have in your data source views (Time_Dimension, Prod_Dimension, Geo_Dimension). When you choose the New Dimension option, you are welcomed to the Dimension Wizard. You need to build the new dimensions by using your data source views. As you can see in Figure 10, the first wizard dialog prompts you to specify whether you will be using a data source to create a dimension. This is the wizard build method. If you haven’t defined any data sources (and perhaps don’t have them yet), you can use a template approach to define dimensions. This is the bottom-most option on this dialog. If you want a time dimension but do not have a previously defined set of tables that represent your time dimension (in your data source), you can choose the second or third options to generate a well-formed time representation via this wizard. We discuss this option later. You do have a valid data source to use, so you will use the first option to create your first dimension (which is a Time Dimension based on the Comp Sales 2008 data warehouse/mart Time_Dimension table).

Figure 10. Creating a dimension by using a data source in the Dimension Wizard.


When you choose the first option (Use an Existing Table), you are prompted to identify the data source view you want to use to provide data to the new dimension. Because you have already defined the data source view in a previous step (the Comp Sales2008 DSV data source view), it should be available for you to use. Figure 11 shows the Comp Sales2008 DSV data source views and all the tables available for your use. You should highlight this data source view along with the main table the dimension will be based on (Time_Dimension table in this case). As you can see in Figure 12, the key columns show up automatically. The fact table’s time is keyed by a pseudo-key called TimeID, with no other key columns needed. You have a chance to identify any other columns you might also want to include in this dimension (do not do so in this example though) and click Next.

Figure 11. Identifying which data source views to use for a dimension in the Dimension Wizard.


Figure 12. The key column of the table the dimension is based on.


You have probably noticed that the time dimension table has all the other levels of the time dimension hierarchy as separate columns in it. A few related tables to this time dimension table hold the member value descriptions that correspond to each level in the hierarchy. It is really nice to have the member-level descriptions available in the cube for ease of use by the end user. It is pretty easy to include these related tables in the next step of generating this dimension. Figure 13 shows the list of related tables identified earlier in the data source views. You need to check all the related tables for inclusion in the time dimension and click Next (they are likely already checked automatically).

 

Figure 13. Including the related member description tables in the dimension in the Dimension Wizard.


It is now time to select the attributes you want to include in the dimension. As shown in Figure 14, the Dimension Wizard presents a Dimension Attributes list, along with the attribute key column and attribute name column correspondences. You need to identify the correct key column value from your data source views for Attribute Key Column. You also should enable these attributes for browsing for your dimension; this essentially makes them available (surfaces them) in your dimension hierarchy. Notice also that you identify the types of attribute characteristics. The default is the Regular attribute for general use. Several other attribute types correspond to the anticipated behavior or characteristics of the attribute itself. They might follow date-based behavior, currency type behavior, or other variations such as slowly changing attributes (and hence slowly changing dimensions). For this example, you check the check box for each dimension attribute you need: All Time, Year Time, Quarter Time, and Month Time, along with the dimension key itself (TimeID). Then, for the selected dimension attributes, you specify the attribute type Regular, check the box for enabling these attributes for browsing, and click Next.

Figure 14. Selecting dimension attributes and attribute types for the dimension in the Dimension Wizard.


As you can see in Figure 15, the last step of the dimension generation process shows you the summary of what you have defined and prompts you to name the dimension you are about to create (Time_Dimension in this case).

Figure 15. Finishing the generation of the time dimension.


After you click Next, you are placed in the dimension designer for the dimension you just created. In addition, a dimension entry is added to the Solution Explorer, and now you can easily create the hierarchical view for this dimension. This task is quite easy because all the attributes that represent a level in a hierarchy are visible (because you enabled them), and you can simply drag them into a hierarchy from within this designer. As you can see in Figure 16, you can click and drag any attribute listed in this dimension from the Attributes pane (on the far left) to the Hierarchies pane. A new hierarchy is created automatically when you pull your first attribute into this work area. Your goal is to create the following hierarchy for the time dimension (in this order, from top to bottom):

  1. All Time

  2. Year Time

  3. Quarter Time

  4. Month Time

Figure 16. Creating the time hierarchy in the dimension designer.


In addition, from this designer, you can click on the Attribute Relationships tab to see how the dimension key relates to any of the other attributes you have defined in the dimension. Usually, there is a correspondence of the key attribute to each of the hierarchy levels (which show how they can be used). Figure 17 shows what was generated by the Dimension Wizard. If you need to specify other attribute relationships, you can easily do so here.

Figure 17. Attribute relationships in your dimension.


If you want to browse the data that will make up your dimension that is coming from the data source, you must first process your dimension (populate the values that represent the dimension and hierarchy). A process icon (the second icon) in the upper-left corner of the dimension structure designer takes you through a two-step process sequence. Step one is to deploy the definitions and see whether any errors might exist. Step two is to populate the values (run the processing). If you like, you can do this now. When this sequence is done, you should be able to open the Dimension Browser and navigate around in your fully populated dimension hierarchy (as shown in Figure 18).

Figure 18. Browsing the time dimension hierarchy.


You will probably notice that the data values being displayed in the time hierarchy are numeric. These are the key values of each level in the hierarchy. If you want to see the full description of the hierarchy values instead of just the key values, you can easily modify the properties of each hierarchy level column’s NameColumn and ValueColumn properties to have them pull the descriptive (more natural) values from the related table entries. You simply browse down into the property window of any level of the hierarchy and update the values with the corresponding column names of the related table’s description column name. The window at the top of Figure 19 shows the top-level column (All Times) column properties with nothing identified in it’s NameColumn or ValueColumn properties (actually (none) is the default). The window at the bottom of Figure 19 shows the same properties updated with the corresponding description columns from the corresponding reference table.

Figure 19. Updating the NameColumn and ValueColumn properties of a dimension hierarchy.


You can now update each level in the hierarchy in the same way (with the corresponding description column for each time hierarchy level) and then reprocess the dimension. When you reload the dimension in the Dimension Browser, you see the full description values displayed, as shown in Figure 20.

Figure 20. Full descriptions of hierarchy levels.


That’s it! You have just generated your first usable dimension for the cube!

If you didn’t have such a well-defined data source set of tables to base your time dimension on, you could use either of the other two kinds of time dimension options within this wizard. As you can see in Figure 21, you need to specify the date periods that will be used when generating the hierarchies, along with the corresponding attributes (time table columns). Setting these attributes is relatively standard.

Figure 21. Specifying the time period and hierarchy attributes when not using a data source table.


Figure 22 shows the different server time dimension options that Microsoft provides for your convenience. Microsoft has tried to cover the primary variations of time dimensions and calendars in the market: Fiscal, Reporting (for example, for Marketing, which also includes week-by-month patterns such as 4-4-5 calendars), Manufacturing, and even ISO 8601 calendars. The process is to first identify a time period and then select the calendar type to use. The wizard then creates a server time dimension that meets your needs.

Figure 22. Calendaring options for server time dimensions in the Dimension Wizard.


Note

You might want to have multiple time dimensions in your cube to fulfill multiple business unit group needs. You can create as many as you need and then provide perspectives of the cube for each group that include only each group’s specific time dimension for its needs.

Other -----------------
- SQL Server 2008 Analysis Services : An Analytics Design Methodology
- SQL Azure : Other Considerations
- SQL Azure : Sample Design - Application SLA Monitoring
- SQL Azure : Combining Patterns
- SQL Server 2008 Analysis Services : Understanding the SSAS Environment Wizards (part 2)
- SQL Server 2008 Analysis Services : Understanding the SSAS Environment Wizards (part 1)
- SQL Server 2008 Analysis Services : Understanding SSAS and OLAP
- SQL Azure : Design Patterns (part 3)
- SQL Azure : Design Patterns (part 2) - Sharding
- SQL Azure : Design Patterns (part 1)
- SQL Azure : Design Factors (part 2)
- SQL Azure : Design Factors (part 1)
- Limitations in SQL Azure
- SQL Server 2008 : Performance Data Collection (part 2)
- SQL Server 2008 : Performance Data Collection (part 1)
- SQL Server 2008 : Performance Tuning - Partitioning
- SQL Server 2008 : Guide to the DYNAMIC Management Views (DMVs)
- SQL Server 2008 : Managing Security - Service Accounts and Permissions
- SQL Server 2008 : Managing Security - Security and SQL Agent
- SQL Server 2008 : Implementing Transactions - Transaction Traps
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us